<template>
	<view class="container">
		<!-- 头部轮播 -->
		<view class="carousel-section">
			<!-- #ifndef MP -->
			<!-- 标题栏和状态栏占位符 -->
			<!-- <view class="titleNview-placing"></view> -->
			<!-- #endif -->
			
			<!-- 背景色区域 -->
			<view class="titleNview-background" style="background:rgb(203, 87, 60)"></view>
			<view class="merchant-wrapper">
				<navigator class="merchant-addr" url="/pages/merchant/nearby">
					<i class="yticon icon-address"></i>
					<view>{{merchantInfo.merchantName||'请选择收货小区'}}</view>
					<i class="yticon icon-you arrow"></i>
				</navigator>
				<view class="merchant-name" v-if="hasMerchant">
					<view class="merchant-photo">
						<image :src="(merchantInfo.photoUrl&&merchantInfo.photoUrl!='null')?merchantInfo.photoUrl: '/static/missing-face.png'" mode="aspectFill"></image>
					</view>
					<view>
						<view>
							{{merchantInfo.contactName}}
						</view>
						<view class="merchant-title">
							团长
						</view>
					</view>
				</view>
			</view>
			<swiper class="carousel" circular @change="swiperChange">
				<swiper-item v-for="(item, index) in carouselList" :key="index" class="carousel-item" @click="navSwiper(item)">
					<image :src="item.url" />
				</swiper-item>
			</swiper>
			<!-- 自定义swiper指示器 -->
			<view class="swiper-dots" v-if="carouselList.length>0">
				<text class="num">{{swiperCurrent+1}}</text>
				<text class="sign">/</text>
				<text class="num">{{swiperLength}}</text>
			</view>
		</view>
		<!-- 分类 -->
		<!-- <view class="cate-section">
			<view class="cate-item" @click="navCoupon">
				<image src="/static/temp/coupon.png"></image>
				<text>领券中心</text>
			</view>
			<view class="cate-item" v-for="cate in cates" @click="navToList(cate.productCateUuid)">
				<image :src="cate.catePicUrl"></image>
				<text>{{cate.cateName}}</text>
			</view>
		</view> -->
		<view class="m-t" v-if="announcement.length>0">
			<uni-notice-bar scrollable="true" showIcon="true" showClose="true" showGetMore="true" :text="announcement[0].title" single="true" moreText="更多" @getmore="navAnnouncement"></uni-notice-bar>
		</view>
			
		<view class="ad-1" v-if="ads.length>0">
			<image @click="navAD(ads[0])" :src="ads[0].url" mode="scaleToFill"></image>
		</view>
		
		<view class="mp-search-box">
			<input class="ser-input" type="text" placeholder="输入关键字搜索" :value="searchKey" disabled @click="navSearch"/>
		</view>
		
		<view class="groupbuy-section">
			<view class="s-header">
				<text @click="groupBuyIndex=1" :class="groupBuyIndex==1?'active':'default'">正在抢购</text>
				<text @click="groupBuyIndex=2" :class="groupBuyIndex==2?'active':'default'">即将开始</text>
			</view>
			<scroll-view id="nav-bar" class="nav-bar" scroll-x scroll-with-animation>
				<view
					v-for="(item,index) in cates" :key="item.cateName"
					class="nav-item"
					:class="{current: index === tabCurrentIndex}"
					:id="'tab'+index"
					@click="changeTab(index)"
				>{{item.cateName}}</view>
			</scroll-view>
			<view class="goods-list">
				<view
					v-for="(item, index) in groupBuyProducts" :key="index"
					class="goods-item"
				>
					<view class="image-wrapper">
						<image v-if="item.productDTO.productMainImage" :src="item.productDTO.productMainImage.url" mode="aspectFill"></image>
					</view>
					<text class="title">{{item.productDTO.productName}}</text>
					<view class="l2">
					<text class="desc">
						预售时间: {{item.startTime.substr(5,2)}}月{{item.startTime.substr(8,2)}}日 - {{item.endTime.substr(5,2)}}月{{item.endTime.substr(8,2)}}日
					</text>
					<text class="unit">
						已售{{item.soldUnit}}件/仅剩{{item.productDTO.totalUnit}}件
					</text>
					</view>
					<view class="price-box">
						<text class="price">{{item.productDTO.unitPrice}}</text>
						<uni-countdown class="countdown" :day="item.groupBuyCountDown.days" :hour="item.groupBuyCountDown.hours" :minute="item.groupBuyCountDown.minutes"
						 :second="item.groupBuyCountDown.seconds" color="#FFFFFF" background-color="#333333" />
						<text v-if="groupBuyIndex==1" class="action" @click="navToDetailPage(item)">立即抢购</text>
						<text v-if="groupBuyIndex==2" class="end" >即将开始</text>
					</view>
				</view>
			</view>
			<!-- 上滑加载更多组件 -->
			<mix-load-more :status="loadMoreStatus"></mix-load-more>
		</view>
	</view>
</template>

<script>
	import uniCountdown from "@/components/uni-countdown/uni-countdown.vue"
	import uniNoticeBar from '@/components/uni-notice-bar/uni-notice-bar.vue'
	import mixPulldownRefresh from '@/components/mix-pulldown-refresh/mix-pulldown-refresh';
	import mixLoadMore from '@/components/mix-load-more/mix-load-more';
	import {
		mapState,
		mapMutations
	} from 'vuex';
	let windowWidth = 0, scrollTimer = false, tabBar;
	export default {
		components: {
			uniCountdown,
			uniNoticeBar,
			mixPulldownRefresh,
			mixLoadMore
		},
		data() {
			return {
				titleNViewBackground: '',
				swiperCurrent: 0,
				swiperLength: 0,
				carouselList: [],
				cates: [],
				secKills: [],
				secKillCountDown: {},
				groupBuyProducts: [],
				groupBuyIndex:1,
				tabCurrentIndex: 0, //当前选项卡索引
				loadMoreStatus: 0, //加载状态
				pageSize: 10,
				pageNo: 1,
				searchKey:"",
				ads: [],
				notice:[],
				announcement:[],
				articleList: []	,//图文, 音视频列表
				secKillFlag:'END'	//秒杀结束标志符(END表示已结束)
			};
		},
		computed: {
			...mapState(['hasLogin','hasMerchant','userInfo', 'merchantInfo','footPrint', 'applicationConfig'])
		},
		onReachBottom() {
			if(this.loadMoreStatus==0){
				this.pageNo++;
				this.searchGroupBuyProduct();
			}
		},
		onLoad(options) {
			this.loadData();
		},
		mounted() {
			// if(!this.hasMerchant){
			// 	uni.navigateTo({
			// 		url: '/pages/merchant/nearby'
			// 	})
			// }
		},
		watch: {
			groupBuyIndex(val) {
				this.resetPage();
				this.searchGroupBuyProduct();
			}
		},
		methods: {
			setSearchKey(searchKey){
				this.searchKey = searchKey;
			},
			//上滑加载
			loadMore(){
				let tabItem = this.tabBars[this.tabCurrentIndex];
				tabItem.pageNo = tabItem.pageNo + 1;
				this.searchGroupBuyProduct('add');
			},
			//tab切换
			async changeTab(e){
				this.resetPage();
				this.tabCurrentIndex = e;
				this.searchGroupBuyProduct();
			},
			/**
			 * 请求静态数据只是为了代码不那么乱
			 * 分次请求未作整合
			 */
			async loadData() {
				this.inquirySwiper();
				this.inquiryAd();
				this.inquiryProductCate();
				// this.inquirySecKill();
				// this.inquiryProductGroup();
				// this.homeData();
			},
			//新闻列表
			searchGroupBuyProduct(){
				let that = this;
				this.loadMoreStatus = 1;
				let keyArray = [];
				let searchOptions = {
					startIndex:(that.pageNo-1)*that.pageSize,
					pageSize:that.pageSize
				};
				let cate = this.cates[this.tabCurrentIndex];
				if(cate.productCateUuid){
					keyArray.push('CATE_NAME');
					searchOptions.cateName = cate.cateName;
				}
				if(this.searchKey){
					keyArray.push('PRODUCT_NAME');
					searchOptions.productName = this.searchKey;
				}
				
				if(this.groupBuyIndex==1){
					keyArray.push('GROUP_BUY_STATUS_BEING');
				}else if(this.groupBuyIndex==2){
					keyArray.push('GROUP_BUY_STATUS_NOT_STARTED');
				}
				searchOptions.keyArray = keyArray;
				this.$api.request.goodsList(searchOptions, function(res) {
					if (res.body.status.statusCode === '0') {
						let groupBuys = res.body.data.groupBuys;
						let groupBuyList = [];
						groupBuys.forEach(function(val,index){
							var time = val.startTime;
							if(that.groupBuyIndex==1){
								time = val.endTime;
							}
							var diff = that.$api.util.getCountDownTimes(time);
							var groupBuyCountDown = {
								days: diff[0],
								hours: diff[1],
								minutes: diff[2],
								seconds: diff[3]
							}
							val.groupBuyCountDown = groupBuyCountDown;
							var endTimeStr = val.endTime;
							var endTime = new Date(Date.parse(endTimeStr.replace(/-/g, "/")));
							val.endFlag=(endTime<new Date());
							groupBuyList.push(val);
						})
						let total = res.body.data.total;
						that.groupBuyProducts = that.groupBuyProducts.concat(groupBuyList);
						that.loadMoreStatus = that.groupBuyProducts.length >= total ? 2: 0;
					}
				},true)
			},
			//轮播图
			inquirySwiper() {
				this.$api.request.slider({}, res => {
					if (res.body.status.statusCode === '0') {
						this.carouselList = res.body.data.swipers;
						this.swiperLength = this.carouselList.length;
						// this.titleNViewBackground = this.carouselList[0].background;
					} else {
						console.log(res.body.status.errorDesc);
					}
				});
			},
			//首页数据
			homeData() {
				let that = this;
				this.$api.request.home({}, res => {
					if (res.body.status.statusCode === '0') {
						this.carouselList = res.body.data.swipers;
						this.swiperLength = this.carouselList.length;
						this.ads = res.body.data.ads;
						this.cates = res.body.data.cates;
						this.groupBuyProducts = res.body.data.groupBuyProducts;
						this.productGroups = res.body.data.groups;
						this.secKills = res.body.data.secKills;
						//用最近的秒杀商品作为秒杀倒计时数据
						if (this.secKills.length > 0) {
							for(var i=0; i<this.secKills.length; i++){
								var endTimeStr = this.secKills[i].endTime;
								var endTime = new Date(Date.parse(endTimeStr.replace(/-/g, "/")));
								var startTimeStr = this.secKills[i].startTime;
								var startTime = new Date(Date.parse(startTimeStr.replace(/-/g, "/")));
								if(endTime>=new Date()){	//未开始或者秒杀中
									var diff = that.$api.util.getCountDownTimes(this.secKills[i].startTime);
									this.secKillCountDown = {
										days: diff[0],
										hours: diff[1],
										minutes: diff[2],
										seconds: diff[3]
									}
									this.secKillFlag = startTime<=new Date()?'START':'';
									break;
								}
							}
						}
					} else {
						console.log(res.body.status.errorDesc);
					}
				});
			},
			//首页广告
			inquiryAd() {
				this.$api.request.advert({
					location: '首页'
				}, res => {
					if (res.body.status.statusCode === '0') {
						this.ads = res.body.data.ads;
					} else {
						console.log(res.body.status.errorDesc);
					}
				});
			},
			resetPage(){
				this.groupBuyProducts = [];
				this.loadMoreStatus = 0;  //加载更多 0加载前，1加载中，2没有更多了
				this.pageNo = 1;
			},
			//首页商品类目
			inquiryProductCate() {
				let that = this;
				this.$api.request.productCate({

				}, res => {
					if (res.body.status.statusCode === '0') {
						this.cates = res.body.data.cates;
						this.cates = [{cateName:'全部'}].concat(this.cates);
						that.searchGroupBuyProduct();
					} else {
						console.log(res.body.status.errorDesc);
					}
				});
			},
			//首页首页商品组
			// inquiryProductGroup() {
			// 	let that = this;
			// 	this.$api.request.productGroup({

			// 	}, res => {
			// 		if (res.body.status.statusCode === '0') {
			// 			this.productGroups = res.body.data.groups;
			// 		} else {
			// 			console.log(res.body.status.errorDesc);
			// 		}
			// 	});
			// },
			//轮播图切换修改背景色
			swiperChange(e) {
				const index = e.detail.current;
				this.swiperCurrent = index;
				this.titleNViewBackground = this.carouselList[index].background;
			},
			//详情页
			navToDetailPage(item) {
				let id = item.groupBuyProductUuid;
				uni.navigateTo({
					url: '/pages/product/product?id='+id
				})
			},
			//轮播图链接
			navSwiper(item) {
				this.$api.util.navSwiper(item);
			},
			//广告链接
			navAD(item) {
				this.$api.util.navAD(item);
			},
			//商品列表页
			navToGroupPage(group) {
				let groupId = group.groupUuid;
				uni.navigateTo({
					url: '/pages/product/group?groupId=' + groupId
				})
			},
			//领券中心
			navCoupon(){
				uni.navigateTo({
					url: '/pages/coupon/list'
				})
			},
			//限时秒杀
			navSecKill(){
				uni.navigateTo({
					url: '/pages/product/seckillList'
				})
			},
			//秒杀详情页
			navSecKillDetail(item){
				let id = item.secKillProductUuid;
				uni.navigateTo({
					url: `/pages/product/seckill?id=${id}`
				})
			},
			//精品团购
			navGroupBuy(){
				uni.navigateTo({
					url: '/pages/product/groupbuyList'
				})
			},
			//团购详情页
			navGroupBuyDetail(item){
				let id = item.groupBuyProductUuid;
				uni.navigateTo({
					url: `/pages/product/groupbuy?id=${id}`
				})
			},
			//商品列表页
			navToList(tid) {
				uni.navigateTo({
					url: '/pages/product/list?cateId=' + tid
				})
			},
			//导航至官方资讯页面
			navAnnouncement: function() {
				var announcement = JSON.stringify(this.announcement);
				announcement = encodeURIComponent(announcement);
				uni.navigateTo({
					url: '/pages/notice/notice?data=' + announcement
				});
			},
			//跳转到发现页
			navFind: function(){
				uni.switchTab({
					url:'/pages/content/index'
				})
			},
			//图文或音视频详情
			navToDetails(item){
				let url = '';
				if(item.articleType==='1' && item.linkType=='自定义内容')	
					url = '/pages/content/details?id='+item.articleUuid;
				if(item.articleType==='1' && item.linkType=='外部链接')
					url = '/pages/content/webView?src='+item.content;
				if(item.articleType==='2' || item.articleType==='3')
					url = '/pages/content/videoDetails?id='+item.articleUuid;
				uni.navigateTo({
					url:url
				})
			},
			navSearch(){
				uni.navigateTo({
					url: '/pages/index/search'
				})
			}
		},
		// #ifndef MP
		// 标题栏input搜索框点击
		onNavigationBarSearchInputClicked: async function(e) {
			// this.$api.msg('点击了搜索框');
			uni.navigateTo({
				url: '/pages/index/search'
			})
		},
		//点击导航栏 buttons 时触发
		onNavigationBarButtonTap(e) {
			const index = e.index;
			if (index === 0) {
				// this.$api.msg('点击了扫描');
				uni.scanCode({
					success:function(res){
						console.log('条码类型：' + res.scanType);
						console.log('条码内容：' + res.result);
						uni.navigateTo({
							url: '/pages/content/webView?src=' + res.result
						})
					}
				})
			} else if (index === 1) {
				// #ifdef APP-PLUS
				const pages = getCurrentPages();
				const page = pages[pages.length - 1];
				const currentWebview = page.$getAppWebview();
				currentWebview.hideTitleNViewButtonRedDot({
					index
				});
				// #endif
				uni.navigateTo({
					url: '/pages/notice/list'
				})
			}
		}
		// #endif
	}
</script>

<style lang="scss">
	.merchant-wrapper{
		position: absolute;
		width: 100%;
		height: 100upx;
		padding:0 30upx;
		color: #fff;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		.merchant-addr{
			display: flex;
			flex-direction: row;
			align-items: baseline;
			font-size: $font-lg;
			white-space: nowrap;
			overflow: hidden;
			text-overflow: ellipsis;
			i{
				margin-right:6upx;
			}
			.arrow{
				margin-left: 6upx;
				font-size: $font-sm;
				columns: $font-color-light;
			}
		}
		.merchant-name{
			display: flex;
			flex-direction: row;
			align-items: center;
			font-size: $font-sm;
			.merchant-photo{
				margin-right: 20upx;
				image{
					width: 80upx;
					height: 80upx;
					border-radius: 50%;
				}
			}
			.merchant-title{
				text-align: center;
				padding: 2upx;
				background: linear-gradient(left, #f9e6af, #ffd465);
				border-radius: 20upx 0 20upx 0;
				color: $font-color-light;
				margin-top: 4upx;
			}
		}
	}
	


	page {
		background: #f5f5f5;
	}

	.m-t {
		margin-top: 16upx;
	}

	/* 头部 轮播图 */
	.carousel-section {
		position: relative;
		padding-top: 10px;

		.titleNview-placing {
			height: var(--status-bar-height);
			padding-top: 44px;
			box-sizing: content-box;
		}

		.titleNview-background {
			position: absolute;
			top: 0;
			left: 0;
			width: 100%;
			height: 526upx;
			transition: .4s;
		}
	}
	/* #ifdef MP */
	.carousel-section {
		.titleNview-background {
			height: 426upx;
		}
	}
	/* #endif */

	.carousel {
		width: 100%;
		height: 350upx;
		margin-top: 100upx;

		.carousel-item {
			width: 100%;
			height: 100%;
			padding: 0 28upx;
			overflow: hidden;
		}

		image {
			width: 100%;
			height: 100%;
			border-radius: 10upx;
		}
	}

	.swiper-dots {
		display: flex;
		position: absolute;
		left: 60upx;
		bottom: 15upx;
		width: 72upx;
		height: 36upx;
		background-image: url();
		background-size: 100% 100%;

		.num {
			width: 36upx;
			height: 36upx;
			border-radius: 50px;
			font-size: 24upx;
			color: #fff;
			text-align: center;
			line-height: 36upx;
		}

		.sign {
			position: absolute;
			top: 0;
			left: 50%;
			line-height: 36upx;
			font-size: 12upx;
			color: #fff;
			transform: translateX(-50%);
		}
	}

	/* 分类 */
	.cate-section {
		display: -webkit-box;
		overflow-x: scroll;
		overflow-y:hidden;
		justify-content: space-around;
		align-items: center;
		flex-wrap: wrap;
		padding: 30upx 22upx;
		background: #fff;
		height: 100px;

		.cate-item {
			display: flex;
			flex-direction: column;
			align-items: center;
			font-size: $font-sm + 2upx;
			color: $font-color-dark;
			width: 25%;
		}

		/* 原图标颜色太深,不想改图了,所以加了透明度 */
		image {
			width: 88upx;
			height: 88upx;
			margin-bottom: 14upx;
			border-radius: 50%;
			opacity: .7;
			box-shadow: 4upx 4upx 20upx rgba(250, 67, 106, 0.3);
		}
	}

	.ad-1 {
		width: 100%;
		height: 210upx;
		padding: 10upx 0;
		background: #fff;

		image {
			width: 100%;
			height: 100%;
		}
	}
	.mp-search-box {
		z-index: 9999;
		width: 100%;
		padding: 20upx 80upx;
	
		.ser-input {
			flex: 1;
			height: 56upx;
			line-height: 56upx;
			text-align: center;
			font-size: 28upx;
			color: $font-color-base;
			border-radius: 20px;
			background: rgba(255, 255, 255, .6);
		}
	}
	.groupbuy-section{
		padding: 4upx 30upx 24upx;
		background: #fff;
		.s-header {
			display: flex;
			align-items: center;
			height: 80upx;
			margin-top: 20upx;
			line-height: 1;
			border-bottom: solid 4upx $uni-color-primary;
			.default{
				background-color: #f5f5f5;
				color: $font-color-base;
				padding: 10upx 15upx;
				font-size: $font-base;
				border-radius: 18upx 18upx 0 0;
				height: 76upx;
				line-height: 60upx;
			}
			.active{
				background-color: $uni-color-primary;
				color: #fff;
				padding: 10upx 15upx;
				font-size: $font-base;
				border-radius: 18upx 18upx 0 0;
				height: 80upx;
				line-height: 60upx;
			}
			.s-img {
				width: 140upx;
				height: 30upx;
			}
		
			.tip {
				font-size: $font-base;
				color: $font-color-light;
				margin: 0 20upx 0 40upx;
			}
		
			.countdown {
				margin: 0 20upx 0 40upx;
			}
		
			.timer {
				display: inline-block;
				width: 40upx;
				height: 36upx;
				text-align: center;
				line-height: 36upx;
				margin-right: 14upx;
				font-size: $font-sm+2upx;
				color: #fff;
				border-radius: 2px;
				background: rgba(0, 0, 0, .8);
			}
			.end{
				font-size: 12px;
				margin-left: 20px;
				background-color: #333;
				color: #fff;
				padding: 5px;
				border-radius: 5px;
			}
		
			.icon-you {
				font-size: $font-lg;
				color: $font-color-light;
				flex: 1;
				text-align: right;
				margin-left: auto;
			}
		}
	}
	/* 顶部tabbar */
	.nav-bar{
		position: relative;
		z-index: 10;
		height: 90upx;
		white-space: nowrap;
		box-shadow: 0 2upx 8upx rgba(0,0,0,.06);
		background-color: #fff;
		.nav-item{
			display: inline-block;
			width: 150upx;
			height: 90upx;
			text-align: center;
			line-height: 90upx;
			font-size: $font-base;
			color: $font-color-base;
			position: relative;
			&:after{
				content: '';
				width: 0;
				height: 0;
				border-bottom: 4upx solid rgba(219, 63, 96, 1);
				position: absolute;
				left: 50%;
				bottom: 0;
				transform: translateX(-50%);
				transition: .3s;
			}
		}
		.current{
			color: rgba(219, 63, 96, 1);
			&:after{
				width: 50%;
			}
		}
	}

	.f-header {
		display: flex;
		align-items: center;
		height: 140upx;
		padding: 6upx 30upx 8upx;
		background: #fff;

		image {
			flex-shrink: 0;
			width: 80upx;
			height: 80upx;
			margin-right: 20upx;
		}

		.tit-box {
			flex: 1;
			display: flex;
			flex-direction: column;
		}

		.tit {
			font-size: $font-lg +2upx;
			color: #font-color-dark;
			line-height: 1.3;
		}

		.tit2 {
			font-size: $font-sm;
			color: $font-color-light;
		}

		.icon-you {
			font-size: $font-lg +2upx;
			color: $font-color-light;
		}
	}

	/* 团购楼层 */
	.group-section {
		background: #fff;

		.g-swiper {
			height: 650upx;
			padding-bottom: 30upx;
		}

		.g-swiper-item {
			width: 100%;
			padding: 0 30upx;
			display: flex;
		}

		image {
			width: 100%;
			height: 460upx;
			border-radius: 4px;
		}

		.g-item {
			display: flex;
			flex-direction: column;
			overflow: hidden;
		}

		.left {
			flex: 1.2;
			margin-right: 24upx;

			.t-box {
				padding-top: 20upx;
			}
		}

		.right {
			flex: 0.8;
			flex-direction: column-reverse;

			.t-box {
				padding-bottom: 20upx;
			}
		}

		.t-box {
			height: 160upx;
			font-size: $font-base+2upx;
			color: $font-color-dark;
			line-height: 1.6;
		}

		.price {
			color: $uni-color-primary;
		}

		.m-price {
			font-size: $font-sm+2upx;
			text-decoration: line-through;
			color: $font-color-light;
			margin-left: 8upx;
		}

		.pro-box {
			display: flex;
			align-items: center;
			margin-top: 10upx;
			font-size: $font-sm;
			color: $font-base;
			padding-right: 10upx;
		}

		.progress-box {
			flex: 1;
			border-radius: 10px;
			overflow: hidden;
			margin-right: 8upx;
		}
	}
	.goods-list{
		overflow-y: scroll;
		display:flex;
		flex-wrap:wrap;
		padding: 0;
		background: linear-gradient(to bottom, #ffffff 0%,#f8f8f8 100%);
		border-radius: 20upx;
		.header{
			width: 100%;
			text-align: center;
			padding: 20upx 0;
			font-size: $font-lg;
			font-color: $font-color-dark;
			image{
				vertical-align: middle;
				height: 60upx;
				width:60upx;
			}
			text{
				padding-left:10upx
			}
		}
		.goods-item{
			display:flex;
			flex-direction: column;
			width: 100%;
			padding: 20upx 0;
			background-color: #fff;
			margin: 10upx 0;
			border-radius: 20upx;
		}
		.image-wrapper{
			width: 100%;
			height: 330upx;
			border-radius: 3px;
			overflow: hidden;
			image{
				width: 100%;
				height: 100%;
				opacity: 1;
			}
		}
		.title{
			font-size: $font-base;
			color: $font-color-dark;
			line-height: 80upx;
			white-space: nowrap;
			overflow: hidden;
			text-overflow: ellipsis;
		}
		.l2{
			display: flex;
			flex-direction: row;
			justify-content: space-between;
			align-items: center;
			line-height: 50upx;
			.desc{
				font-size: $font-sm;
				color: $uni-color-warning;
			}
			.unit{
				font-size: $font-sm;
				color: $font-color-light;
			}
		}
		
		.price-box{
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 10upx 10upx 10upx 0;
			font-size: 24upx;
			color: $font-color-light;
			.action{
				background-color: $base-color;
				border-radius: 10upx;
				box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
				color: #fff;
				padding: 10upx;
				font-size: $font-base;
			}
			.end{
				background-color: #D6D6D6;
				border-radius: 10upx;
				color: #fff;
				padding: 10upx;
				font-size: $font-base;
			}
		}
		.price{
			font-size: $font-lg;
			color: $uni-color-primary;
			line-height: 1;
			&:before{
				content: '￥';
				font-size: 26upx;
			}
		}
	}
</style>
